home *** CD-ROM | disk | FTP | other *** search
-
- /*
- CLUTLess
- In some instances it is desireable to store picts stripped of
- CLUTs in order to save some room in the disk. This sample shows
- how to create such picts and how to properly display them back.
-
- SimpleInC.c -- initialization stuff and event loop
- CLUTLess.c -- code that does the creation of the clut less pict;
- shows also how to display the pictures.
-
- */
-
- /* all the includes we need. */
- #include <Memory.h>
- #include <QDOffscreen.h>
- #include <Resources.h>
- #include <StandardFile.h>
- #include <ToolUtils.h>
-
- #define desiredDepth 8 // the exercise is meant for eight bit deep images
- #define pictID 128 // source image
-
- PicHandle gOrigPict = 0L, // Holds the original picture
- gModPict = 0L, // for the modified picture
- gCurrPict = 0L; // pict to be used when updating the window
- extern CTabHandle gSharedClut; // we use this to create the 'clut' resource
- // later we use it for reading in the 'clut'
-
- /* clutless.c */
- Boolean SetupPictures(void);
- PicHandle CreateCLUTLessPict(GWorldPtr myGWorld);
- Boolean SaveCLUTLessPict(PicHandle aPict);
- pascal void AddClutProc(BitMap *src, Rect *srcR, Rect *dstR, short mode, RgnHandle msk);
- void InitProcs(CQDProcs *theProcs);
- Boolean SavePicture(void);
-
- /* clutlessFile.c */
- extern short OpenPictureFile(SFReply *reply);
- extern void KillFile(short ref, SFReply *reply);
- extern void ClosePictureFile(short ref, SFReply *reply, PicHandle aPict);
- extern void SaveCLUTResource(SFReply *sfr);
- extern Boolean GetPictBack(void);
-